﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace TreaShares.Backoffice
{
    public partial class BasePage :Page
    {

        protected override void OnPreInit(EventArgs e)
        {
            if (Context.User.IsInRole("Administrator"))
            {
                this.UserRole = "Administrator";
                this.Theme = "Administrator";
            }
            else if (Context.User.IsInRole("PowerUser"))
            {
                this.UserRole = "PowerUser";
                this.Theme = "PowerUser";
            }
            else if (Context.User.IsInRole("User"))
            {
                this.UserRole = "User";
                this.Theme = "User";
            }
            
           
            base.OnPreInit(e);
        }
        public string UserRole { get; set; }
        
    }
}
